package sketch.icse11nier;

import sketch.ounit.Observer;
import sketch.ounit.Values;
import sketch.specs.annotation.TestSketch;
import treemap.TreeMap;
import junit.framework.TestCase;
/**
 * For ICSE'NIER submission, this two sketches achieves 81% and 75% coverage
 * */
public class Z_Sketch_TreeMap extends TestCase {
	@TestSketch //15 lines
	public void testExhRemove0() {
		TreeMap map = new TreeMap();
		Integer[] ints = Values.exhaust(1, 2, 3, 4);
		for (int i : ints) {
			map.put(i);
		}
		Integer[] rints = Values.exhaust(1,-10000, 2, 4, 3, 10000);
		for(int ri : rints) {
			map.remove(ri);
		}
		Observer.observeExpr(map.size());
		map.print();
		Observer.observeExpr(map.toString());
	}	
	@TestSketch //18 lines
	public void testRemoveOutOfOrder6() {
		TreeMap map = new TreeMap();
		{/*@ChooseAllOrNone*/
		  map.put(5);
		  map.put(4);
		  map.put(3);
		  map.put(2);
		  map.put(1);
		}
		//map.remove(Values.symbolicInt());
		Observer.observeExpr(map.size());
		map.print();
		Observer.observeExpr(map.toString());
		int level = Values.choose(1, 2, 3, 4,5);
		{/*@Repeat*/
			Observer.observeExpr(map.concreteString(level));
		}
	}
}